home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
scopedisk25.bak
/
VirusX20
/
vx.asm
< prev
Wrap
Assembly Source File
|
1988-09-09
|
1KB
|
57 lines
;
;
;
; The ASSEMBLER portion of VirusX starts here. This is where some of the
; more often called routines now live - in the smallness of Assembler.
;
;
xref _geta4
xref _diskreq
xref _diskbuffer
xref _LVODoIO
xdef _ReadBlock
;
; ReadBlock: This will read the boot block. Yay.
;
_ReadBlock:
movem.l d1/a0/a1/a4/a5/a6,-(sp)
jsr _geta4
move.l _diskreq,a0
move.w #2,$1c(a0) ; diskreq->io_Command = CMD_READ;
lea _diskbuffer,a1
move.l a1,d0
move.l d0,$28(a0) ; diskreq->io_Data = diskbuffer;
move.l #(3*512),$24(a0) ; diskreq->io_Length = 3*512;
move.l #0,$2c(a0) ; diskreq->io_Offset = 0;
move.l 4,a6
move.l _diskreq,a1
jsr _LVODoIO(a6) ; DoIO(diskreq);
move.l _diskreq,a0
cmp.b #0,$1f(a0) ; check io_Error
beq IsOkay ; if (diskreq->io_Error > 0) return(FALSE); /* disk error, lemme out */
ReturnError:
move.l #0,d0 ; return error
movem.l (sp)+,d1/a0/a1/a4/a5/a6
rts
IsOkay:
move.l #0,$24(a0) ; diskreq->io_Length = 0;
move.w #9,$1c(a0) ; diskreq->io_Command = TD_MOTOR;
move.l _diskreq,a1
move.l 4,a6
jsr _LVODoIO(a6) ; DoIO(diskreq); /* turn off motor */
move.l _diskreq,a0
cmp.b #0,$1f(a0)
bne ReturnError
move.l #1,d0
movem.l (sp)+,d1/a0/a1/a4/a5/a6
rts